# Contributor: prspkt <prspkt@protonmail.com>
# Maintainer: prspkt <prspkt@protonmail.com>
pkgname=py3-itemadapter
pkgver=0.8.0
pkgrel=3
pkgdesc="Common interface for data container classes"
options="!check" # Introduces circular dependency with py3-scrapy
url="https://github.com/scrapy/itemadapter"
arch="noarch"
license="BSD-3-Clause"
depends="python3"
makedepends="py3-setuptools py3-gpep517"
checkdepends="py3-pytest py3-scrapy"
subpackages="$pkgname-pyc"
source="https://github.com/scrapy/itemadapter/archive/v$pkgver/itemadapter-$pkgver.tar.gz"
builddir="$srcdir/itemadapter-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	gpep517 install-wheel --destdir .testenv --prefix '' .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	gpep517 install-wheel --destdir "$pkgdir" \
		.dist/*.whl
}

sha512sums="
86c688bef2d0add3f5ea2bd119689b076c5bc9f92edefb6f5d8faaf88023355e7d2ba5d683ce8f6acd24a2954c5a798902b30d0a70ca31dc32eb5245ad57953f  itemadapter-0.8.0.tar.gz
"
